﻿using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System;
using Doddle.Linq.Audit;

namespace SPU.Entities
{
    public partial class SPUSystemDataContext : Doddle.Linq.Audit.LinqToSql.AuditableDataContext
    {
        protected override void InsertAuditRecordToDatabase(AuditedEntity record)
        {
            AuditRecord audit = new AuditRecord();
            audit.Action = (byte)record.Action;
            audit.AuditDate = DateTime.Now;
            audit.AssociationTable = record.AssociationTable;
            audit.AssociationTableKey = record.AssociationTableKey;
            audit.EntityTable = record.EntityTable;
            audit.EntityTableKey = record.EntityTableKey;
        }

        protected override void DefaultAuditDefinitions()
        {
        }
    }
}
